* This file codes Study 1 data for Timothy J. Ryan, 
* "Actions Versus Consequences in Political Arguments: Insights 
* from Moral Psychology" (JOP). Analysis was conducted on 
* Stata/SE 14.2 for Mac (64-bit Intel).

use "Study1_raw.dta", clear

* Extremity
gen socsecop2 = Q1-1
gen socsecop = socsecop2/6
gen extfold = sqrt((socsecop - .5)^2)*2
drop socsecop

* Importance
gen imp = Q2
replace imp = . if imp==-1
replace imp = (imp - 1)/4

* Relevance
gen relev = Q3
replace relev = . if Q3==-1
replace relev = (relev - 1)/4

* Moral Conviction
gen mor1 = Q4
replace mor1 = . if Q4==-1
replace mor1 = (mor1 - 1)/4

gen mor2 = Q4_1
replace mor2 = . if Q4_1==-1
replace mor2 = (mor2 - 1)/4

alpha mor1 mor2, gen(mor) // Alpha =.92

* Argument quality
gen qual = Q5
replace qual = . if qual==-1
replace qual = (qual - 1)/4

* Age
egen agebin = cut(PPAGE), at(18,29,39,49,59,69,120) icodes

* Female
recode PPGENDER (1 = 0) (2 = 1), gen(female)

* Partisanship
gen pidr2 = 7 - PARTY7
gen pidr = pidr2 / 6
drop pidr2

* Ideology
gen ideol = IDEO
replace ideol = . if IDEO==-1
replace ideol = (ideol - 1)/6

* Education
recode PPEDUC (1 3 4 5 6 7 8 = 0) (9 = 1) (10 11 = 2) (12 = 3) (13 14 = 4), gen(educ)
lab def educ 0 "No Diploma" 1 "HS Only" 2 "Some Col." 3 "BA" 4 "Grad degree"
lab val educ educ

* Race
recode PPETHM (1 = 0) (2 = 1) (3 = 4) (4 = 4) (5 = 4), gen(race)
lab def race 0 "White" 1 "Black" 4 "Other"
lab val race race

* Experimental condition
egen cond5 = rowmax(CONDITION_*)
lab def cond5 1 "Lib conseq" 2 "Cons conseq" 3 "Lib deont" 4 "Cons deont" 5 "Control"
lab val cond5 cond5

gen conseq = .
replace conseq = 1 if cond5==1 | cond5==2
replace conseq = 0 if cond5==3 | cond5==4
drop cond5

* Issue side (Pro- or Con-Social Security)
recode socsecop2 (0/2=1) (3=.) (4/6=2), gen(issside)
lab def issside 1 "Liberal" 2 "Conserv."
lab val issside issside


save "Study1_working.dta", replace
